package com.mall.goods.feign;


import com.mall.cart.model.Cart;
import com.mall.goods.model.Sku;
import com.mall.util.RespResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("mall-goods")
public interface SkuFeign {


    /***
     * 库存递减
     */
    @PostMapping(value = "/sku/dcount")
    RespResult dCount(@RequestBody List<Cart> carts);

    /***
     * 根据ID查询商品详情
     * @return
     */
    @GetMapping(value = "/sku/{id}")
    RespResult<Sku> one(@PathVariable(value = "id")String id);

    @GetMapping(value = "/sku/aditems/type")
    public List<Sku> typeItems(@RequestParam(value = "id")Integer id);

    @DeleteMapping(value = "/sku/aditems/type")
    public RespResult delTypeItems(@RequestParam(value = "id")Integer id);

    @PutMapping(value = "/sku/aditems/type")
    public RespResult updateTypeItems(@RequestParam(value = "id")Integer id);

}
